package com.im.server.enterprise.common.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.im.base.dao.BaseDAO;
import com.im.server.enterprise.common.bean.DepartmentMember;

/**
 * 描述：
 * 
 * @author XiaHui
 * @date 2014年6月14日 下午4:17:01
 * @version 0.0.1
 */
@Repository
public class DepartmentMemberDAO extends BaseDAO {

	public DepartmentMember get(String id) {
		return this.readDAO.get(DepartmentMember.class, id);
	}

	@SuppressWarnings("unchecked")
	public List<DepartmentMember> getAllList() {
		String hql = "from " + DepartmentMember.class.getName();
		List<DepartmentMember> list = (List<DepartmentMember>) this.readDAO.getHibernateTemplate().find(hql);
		return list;
	}

	public List<String> getDepartmentMemberIdList(String departmentId) {
		String sql = "select userId from im_department_member where departmentId='" + departmentId + "'";
		List<String> list = this.readDAO.queryList(sql, null, String.class, null);
		return list;
	}
}
